package com.dmxh.controller;

import com.dmxh.pojo.TbItem;
import com.dmxh.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/item")
public class ItemController {

    @Autowired
    private ItemService itemService;

    @GetMapping("/queryById")
    public TbItem queryById(@RequestParam long id) {
        return itemService.queryById(id);
    }

    //更新库存
    @PostMapping("/defStockCount")
    public void defStockCount(@RequestBody List<TbItem> list) {
        itemService.defStockCount(list);
    }
}
